Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clone to Data.Array.ST #243

Merged
merged 4 commits into from
Nov 2, 2023
Merged

Add clone to Data.Array.ST #243

merged 4 commits into from
Nov 2, 2023

Conversation

gbagan
Copy link
Contributor

@gbagan gbagan commented Oct 31, 2023

Description of the change

This PR adds clone :: forall h a. STArray h a -> ST h (STArray h a) to the Data.Array.ST module.
It makes a mutable copy of a mutable array.
This is similar to the clone function in the Haskell module Data.Vector.Mutable.
This is equivalent to unsafeThaw <<< freeze but more readable.
I need it in one of my projects.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

test/Test/Data/Array/ST.purs Outdated Show resolved Hide resolved
@garyb
Copy link
Member

garyb commented Nov 2, 2023

Could you add a note to the changelog too?

@garyb
Copy link
Member

garyb commented Nov 2, 2023

Thanks!

@garyb garyb merged commit d521e17 into purescript:master Nov 2, 2023
@garyb
Copy link
Member

garyb commented Nov 3, 2023

Now released as v7.3.0, apologies for the delay 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants